<%
layout("/common/layout.html",{title:blog.title!"博客详情"}){
%>

<article class="blog-post">
        <header>

            <div class="lead-image">
                <img src="${ctxPath}/${blog.img!}" alt="" class="img-responsive">

            </div>
        </header>
        <div class="body">
            <h1>${blog.title!}</h1>
            <div class="meta">
                <i class="fa fa-user"></i> ${blogCreateUser!} <i class="fa fa-calendar"></i>${blog.createTime,'yyyy-MM-dd HH:mm:ss'}<i class="fa fa-comments"></i><span class="data"><a href="#comments">${msgPage.totalRow!} Comments</a></span>
            </div>
            ${blog.content!}
        </div>
    </article>

    <aside class="social-icons clearfix">
        <h3>Share on </h3>
        <a href="#"><i class="fa fa-facebook"></i></a> <a href="#"><i class="fa fa-twitter"></i></a> <a href="#"><i class="fa fa-google"></i></a>
    </aside>

    <aside class="comments" id="comments">
        <hr>

        <h2><i class="fa fa-comments"></i> ${msgPage.totalRow!} Comments</h2>

        <%for(msg in msgPage.list){%>
        <article class="comment">
            <header class="clearfix">
                <img src="${ctxPath}/img/avatar.png" alt="A Smart Guy" class="avatar">
                <div class="meta">
                    <h3><a href="#">${msg.nickName!}</a></h3>
                    <span class="date">
                                        ${printTime(msg.createTime!,"yyyy-MM-dd HH:mm:ss")}
                                    </span>
                    <span class="separator">
                                        -
                                    </span>

                    <a href="#create-comment" class="reply-link">Reply</a>
                </div>
            </header>
            <div class="body">
                ${msg.content!}
            </div>
        </article>
        <%}%>
        <br/><br/>
        <#page page="${msgPage}" condition='${"&id="+blog.id!}' action="detail"/>
    </aside>

    <aside class="create-comment" id="create-comment">
        <hr>

        <h2><i class="fa fa-pencil"></i> Add Comment</h2>

        <form action="/saveMessage" method="post" accept-charset="utf-8">
            <input type="text" name="nickName" id="comment-url" placeholder="NickName" class="form-control input-lg">
            <input type="hidden" name="blogId" value="${blog.id!}">
            <textarea rows="10" name="content" id="comment-body" placeholder="Your Message" class="form-control input-lg"></textarea>

            <div class="buttons clearfix">
                <button type="submit" class="btn btn-xlarge btn-clean-one">Submit</button>
            </div>
        </form>
    </aside>
<%}%>